﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.IO;

namespace Tools
{
    public class Config
    {
        static XmlElement rootNode;

        static Config()
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(Path.Combine(BaseDirectory, @"config\conf.xml"));
            rootNode = xmlDoc.DocumentElement;
        }

        public static XmlNodeList GetConfigObject(string xpath)
        {
            return rootNode.SelectNodes(xpath);
        }

        public static string BaseDirectory
        {
            get
            {
                return System.AppDomain.CurrentDomain.BaseDirectory;
            }
        }

    }
}
